var e = require("../../@babel/runtime/helpers/interopRequireDefault").default, t = e(require("../../kta/index")), n = e(require("../../api/api_aniversary"));

function r(e) {
    return "http://txwk.10010.com/miniprogram_kcard/bookAniversaryLives/" + e + ("?random=" + Date.now());
}

t.default.Page({
    data: {
        data: {}
    },
    onLoad: function() {
        this.refreshImages();
    },
    onPullDownRefresh: function() {
        this.refreshImages(), wx.stopPullDownRefresh();
    },
    onShareAppMessage: function() {
        return {
            title: "周年庆直播狂欢"
        };
    },
    refreshImages: function() {
        this.setData({
            data: {
                headerImg: r("header.png"),
                liBgImg: r("item-bg.png"),
                liBannerBgImg: r("banner-bg.png"),
                list: [ {
                    roomId: "77",
                    titleImg: r("77/title.png"),
                    banner: r("77/banner.png"),
                    productImg: r("77/product.png")
                }, {
                    roomId: "78",
                    titleImg: r("78/title.png"),
                    banner: r("78/banner.png"),
                    productImg: r("78/product.png")
                }, {
                    roomId: "79",
                    titleImg: r("79/title.png"),
                    banner: r("79/banner.png"),
                    productImg: r("79/product.png")
                }, {
                    roomId: "80",
                    titleImg: r("80/title.png"),
                    banner: r("80/banner.png"),
                    productImg: r("80/product.png")
                }, {
                    roomId: "81",
                    titleImg: r("81/title.png"),
                    banner: r("81/banner.png"),
                    productImg: r("81/product.png")
                } ]
            }
        });
    },
    onBannerClick: function(e) {
        var n = e.target.dataset.roomid;
        t.default.clickStat("52e07fe2d3824d2c9fb596d8b8b82537", {
            roomId: n
        }), wx.navigateTo({
            url: "plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=".concat(n)
        });
    },
    onSubscribeClick: function(e) {
        if (e.detail && e.detail.is_subscribe) {
            var r = e.detail.room_id;
            t.default.clickStat("52e07fe2d3824d2c9fb596d8b8b82537", {
                roomId: r
            }), n.default.subscribeReport({
                roomId: r
            }).then(function() {}).catch(function(e) {
                console.log(e);
            });
        }
    }
});